//@ts-nocheck
import React from 'react';
import ReactDOM from 'react-dom';
import 'antd/dist/antd.css';
import {/*Upload,*/ Icon, message} from 'antd';
import Dragger, {DraggerProps,UploadFile} from './index';

const props: DraggerProps = {
  name: 'file'
  , action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76'
  , onChange: (uploadFile: UploadFile) => {
    console.log('onChange -> uploadFile:',uploadFile);
    const {status} = uploadFile;
    if(status === 'done'){
      message.success(`${uploadFile.file!.name}上传成功`);
    }else if(status === 'error'){
      message.error(`${uploadFile.file!.name}上传失败`);
    }
  }
};

ReactDOM.render(
  <Dragger {...props}>
    <Icon type="inbox"/>
  </Dragger>
  , document.getElementById('root')
);
